#!/bin/python3
# #-*- coding: utf-8 -*-


#输入某年某月某日，判断这一天是这一年的第几天？

import datetime
year = int(input("year:\n"))
month = int(input("month:\n"))
day =int(input("day:\n"))

a=datetime.date(year,month,day)
print (a.toordinal()-datetime.date(year,1,1).toordinal())